﻿using System;
using System.Linq;
using Character;
using UnityEngine;
using UnityEngine.Rendering;

// Token: 0x0200015F RID: 351
public class Wears
{
	// Token: 0x0600091E RID: 2334 RVA: 0x000352EC File Offset: 0x000334EC
	public Wears(SEX sex, WearParameter wearParam, Transform charaRoot, Human human)
	{
		this.sex = sex;
		this.wearParam = wearParam;
		this.wearsRoot = charaRoot.Find(Wears.name_wearsRoot);
		this.human = human;
		if (sex == SEX.MALE)
		{
			this.baseBoneRoot = charaRoot.Find(Wears.name_baseBoneRoot_M).transform;
			this.skinObj = Transform_Utility.FindTransform(charaRoot, Wears.name_skinObj_M).gameObject;
			this.wear_meshRootName = Wears.name_wear_meshRootName_M;
		}
		else if (sex == SEX.FEMALE)
		{
			this.baseBoneRoot = charaRoot.Find(Wears.name_baseBoneRoot_F).transform;
			this.skinObj = Transform_Utility.FindTransform(charaRoot, Wears.name_skinObj_F).gameObject;
			this.wear_meshRootName = Wears.name_wear_meshRootName_F;
		}
		this.bodySkinMesh = this.skinObj.GetComponent<SkinnedMeshRenderer>();
		for (int i = 0; i < this.showModes.Length; i++)
		{
			this.showModes[i] = WEAR_SHOW.ALL;
		}
	}

	// Token: 0x17000128 RID: 296
	// (get) Token: 0x0600091F RID: 2335 RVA: 0x00035400 File Offset: 0x00033600
	public GameObject[] objWear
	{
		get
		{
			return (from v in this.wearObjs
			select (v == null) ? null : v.obj).ToArray<GameObject>();
		}
	}

	// Token: 0x06000920 RID: 2336 RVA: 0x00035430 File Offset: 0x00033630
	public WearData GetWearData(WEAR_TYPE type)
	{
		if (this.wearParam.wears[(int)type] == null)
		{
			return null;
		}
		int id = this.wearParam.wears[(int)type].id;
		return CustomDataManager.GetWearData(this.sex, type, id);
	}

	// Token: 0x06000921 RID: 2337 RVA: 0x00035478 File Offset: 0x00033678
	public WearObj GetWearObj(WEAR_TYPE type)
	{
		return this.wearObjs[(int)type];
	}

	// Token: 0x06000922 RID: 2338 RVA: 0x00035484 File Offset: 0x00033684
	public void WearInstantiate(WEAR_TYPE type, Material skinMaterial, Material customHighlightMat_Skin)
	{
		int num = (int)type;
		if (this.wearParam.wears[num] == null)
		{
			return;
		}
		this.DeleteWear(type);
		if (!Wears.IsEnableWear(this.wearParam.isSwimwear, type))
		{
			this.CheckBodyShow(true);
			return;
		}
		WearData wearData = this.GetWearData(type);
		if (wearData == null)
		{
			this.CheckBodyShow(true);
			return;
		}
		GameObject gameObject = AssetBundleLoader.LoadAndInstantiate<GameObject>(wearData.assetbundleDir, wearData.assetbundleName, wearData.prefab);
		if (gameObject == null)
		{
			this.CheckBodyShow(true);
			return;
		}
		wearData.isNew = false;
		if (!GlobalData.vr_event_item && wearData.special == ItemDataBase.SPECIAL.VR_EVENT)
		{
			GlobalData.vr_event_item = true;
		}
		gameObject.transform.SetParent(this.wearsRoot);
		this.wearObjs[num] = new WearObj(this.wearParam, type, gameObject, wearData);
		this.wearObjs[num].UpdateColorCustom();
		Transform transform = Transform_Utility.FindTransform(gameObject.transform, this.wear_meshRootName);
		if (transform != null)
		{
			AttachBoneWeight.Attach(this.baseBoneRoot.gameObject, transform.gameObject, true);
		}
		else
		{
			GlobalData.Debug_LogWarning(type.ToString() + " " + this.wear_meshRootName + "なし");
		}
		this.ReAttachDynamicBone(gameObject);
		string text = wearData.liquid.ToLower();
		if (CustomDataManager.WearLiquids.ContainsKey(text))
		{
			string assetBundleName = CustomDataManager.WearLiquids[text];
			string text2 = GlobalData.assetBundlePath + "/wearliquid";
			GameObject gameObject2 = AssetBundleLoader.LoadAndInstantiate<GameObject>(GlobalData.assetBundlePath, assetBundleName, text);
			gameObject2.transform.SetParent(this.wearsRoot);
			this.wearObjs[num].liquid = new WearLiquidObj(gameObject2);
			transform = Transform_Utility.FindTransform(gameObject2.transform, this.wear_meshRootName);
			if (transform != null)
			{
				AttachBoneWeight.Attach(this.baseBoneRoot.gameObject, transform.gameObject, true);
			}
			else
			{
				GlobalData.Debug_LogWarning(type.ToString() + " " + this.wear_meshRootName + "なし");
			}
		}
		if (type == WEAR_TYPE.TOP)
		{
			Renderer[] componentsInChildren = gameObject.GetComponentsInChildren<Renderer>(true);
			foreach (Renderer renderer in componentsInChildren)
			{
				if (renderer.sharedMaterial == null)
				{
					renderer.sharedMaterial = this.bodySkinMesh.sharedMaterial;
					renderer.reflectionProbeUsage = ReflectionProbeUsage.Off;
				}
				else if (renderer.sharedMaterial.name == this.bodySkinMesh.sharedMaterial.name)
				{
					renderer.sharedMaterial = this.bodySkinMesh.sharedMaterial;
					renderer.reflectionProbeUsage = ReflectionProbeUsage.Off;
				}
				else if (renderer.sharedMaterial.name.IndexOf(Wears.name_defMaterial) == 0)
				{
					renderer.sharedMaterial = this.bodySkinMesh.sharedMaterial;
					renderer.reflectionProbeUsage = ReflectionProbeUsage.Off;
				}
			}
			this.skinObj.SetActive(false);
			if (this.human != null)
			{
				this.human.body.ShowNip(wearData.nip);
			}
			this.ChangeBodyMaterial(this.bodySkinMesh);
		}
		this.UpdateShow(type);
		this.CheckBodyShow(true);
		Renderer[] componentsInChildren2 = gameObject.GetComponentsInChildren<Renderer>(true);
		foreach (Renderer renderer2 in componentsInChildren2)
		{
			renderer2.gameObject.layer = this.baseBoneRoot.gameObject.layer;
			renderer2.lightProbeUsage = LightProbeUsage.Off;
		}
	}

	// Token: 0x06000923 RID: 2339 RVA: 0x0003582C File Offset: 0x00033A2C
	public bool EnableColorCustom(WEAR_TYPE type)
	{
		return this.wearObjs[(int)type] != null && this.wearObjs[(int)type].enableColorCustom;
	}

	// Token: 0x06000924 RID: 2340 RVA: 0x00035858 File Offset: 0x00033A58
	public bool EnableSecondColorCustom(WEAR_TYPE type)
	{
		return this.wearObjs[(int)type] != null && this.wearObjs[(int)type].hasSecondColor;
	}

	// Token: 0x06000925 RID: 2341 RVA: 0x00035884 File Offset: 0x00033A84
	public bool EnableSecondSpecularCustom(WEAR_TYPE type)
	{
		return this.wearObjs[(int)type] != null && this.wearObjs[(int)type].hasSecondSpecular;
	}

	// Token: 0x06000926 RID: 2342 RVA: 0x000358B0 File Offset: 0x00033AB0
	public void UpdateColorCustom(WEAR_TYPE type)
	{
		if (this.wearObjs[(int)type] != null)
		{
			this.wearObjs[(int)type].UpdateColorCustom();
		}
	}

	// Token: 0x06000927 RID: 2343 RVA: 0x000358DC File Offset: 0x00033ADC
	public void DeleteWear(WEAR_TYPE type)
	{
		if (this.wearObjs[(int)type] != null)
		{
			if (this.wearObjs[(int)type].liquid != null)
			{
				UnityEngine.Object.Destroy(this.wearObjs[(int)type].liquid.root);
			}
			UnityEngine.Object.Destroy(this.wearObjs[(int)type].obj);
			this.wearObjs[(int)type] = null;
		}
	}

	// Token: 0x06000928 RID: 2344 RVA: 0x0003593C File Offset: 0x00033B3C
	public void ChangeSwimOption_Top(bool show = true)
	{
		WearObj wearObj = this.wearObjs[4];
		if (wearObj == null)
		{
			return;
		}
		Transform transform = Transform_Utility.FindTransform(wearObj.obj.transform, Wears.name_swimOptTop);
		if (transform != null)
		{
			bool flag = show && this.GetShow(WEAR_SHOW_TYPE.SWIMUPPER, true) != WEAR_SHOW.HIDE;
			transform.gameObject.SetActive(this.wearParam.swimOptTop && flag);
		}
	}

	// Token: 0x06000929 RID: 2345 RVA: 0x000359B4 File Offset: 0x00033BB4
	public void ChangeSwimOption_Bottom(bool show = true)
	{
		WearObj wearObj = this.wearObjs[4];
		if (wearObj == null)
		{
			return;
		}
		Transform transform = Transform_Utility.FindTransform(wearObj.obj.transform, Wears.name_swimOptBot);
		if (transform != null)
		{
			bool flag = show && this.GetShow(WEAR_SHOW_TYPE.SWIMLOWER, true) != WEAR_SHOW.HIDE;
			transform.gameObject.SetActive(this.wearParam.swimOptBtm && flag);
		}
	}

	// Token: 0x0600092A RID: 2346 RVA: 0x00035A2C File Offset: 0x00033C2C
	public void Release()
	{
		for (int i = 0; i < this.wearObjs.Length; i++)
		{
			if (this.wearObjs[i] != null)
			{
				UnityEngine.Object.Destroy(this.wearObjs[i].obj);
				this.wearObjs[i] = null;
			}
		}
	}

	// Token: 0x0600092B RID: 2347 RVA: 0x00035A7C File Offset: 0x00033C7C
	public void CheckShow(bool show = true)
	{
		this.UpdateShow(WEAR_TYPE.TOP);
		this.UpdateShow(WEAR_TYPE.BOTTOM);
		this.UpdateShow(WEAR_TYPE.BRA);
		this.UpdateShow(WEAR_TYPE.SHORTS);
		this.UpdateShow(WEAR_TYPE.SWIM);
		this.UpdateShow(WEAR_TYPE.SWIM_TOP);
		this.UpdateShow(WEAR_TYPE.SWIM_BOTTOM);
		this.CheckBodyShow(show);
		this.ChangeSwimOption_Top(show);
		this.ChangeSwimOption_Bottom(show);
	}

	// Token: 0x0600092C RID: 2348 RVA: 0x00035AD0 File Offset: 0x00033CD0
	private void CheckBodyShow(bool show = true)
	{
		bool flag = this.wearParam.isSwimwear || this.wearObjs[0] == null || this.GetShow(WEAR_SHOW_TYPE.TOPUPPER, true) == WEAR_SHOW.HIDE;
		if (!show)
		{
			flag = false;
		}
		this.skinObj.SetActive(flag);
		if (this.sex == SEX.FEMALE)
		{
			bool show2 = true;
			if (!this.wearParam.isSwimwear)
			{
				int wearID = this.wearParam.GetWearID(WEAR_TYPE.TOP);
				WearData wearData_Female = CustomDataManager.GetWearData_Female(WEAR_TYPE.TOP, wearID);
				bool flag2 = wearData_Female != null && !wearData_Female.nip && this.GetShow(WEAR_SHOW_TYPE.TOPUPPER, true) == WEAR_SHOW.ALL;
				bool flag3 = false;
				if (flag2 || flag3)
				{
					show2 = false;
				}
			}
			if (!show)
			{
				show2 = false;
			}
			if (this.human != null)
			{
				this.human.body.ShowNip(show2);
			}
			bool show3 = true;
			if (this.wearParam.isSwimwear)
			{
				int wearID2 = this.wearParam.GetWearID(WEAR_TYPE.SWIM);
				WearData wearData_Female2 = CustomDataManager.GetWearData_Female(WEAR_TYPE.SWIM, wearID2);
				if (wearID2 != 50 && wearData_Female2 != null && !wearData_Female2.underhair && this.GetShow(WEAR_SHOW_TYPE.SWIMLOWER, true) == WEAR_SHOW.ALL)
				{
					show3 = false;
				}
			}
			else
			{
				int wearID3 = this.wearParam.GetWearID(WEAR_TYPE.SHORTS);
				WearData wearData_Female3 = CustomDataManager.GetWearData_Female(WEAR_TYPE.SHORTS, wearID3);
				if (wearID3 != 0 && wearData_Female3 != null && this.GetShow(WEAR_SHOW_TYPE.SHORTS, true) == WEAR_SHOW.ALL)
				{
					show3 = false;
				}
			}
			int wearID4 = this.wearParam.GetWearID(WEAR_TYPE.PANST);
			WearData wearData_Female4 = CustomDataManager.GetWearData_Female(WEAR_TYPE.PANST, wearID4);
			if (wearData_Female4 != null && this.GetShow(WEAR_SHOW_TYPE.PANST, true) == WEAR_SHOW.ALL && !wearData_Female4.underhair)
			{
				show3 = false;
			}
			if (!show)
			{
				show3 = false;
			}
			if (this.human != null)
			{
				this.human.body.ShowUnderHair3D(show3);
			}
		}
		else if (this.human != null)
		{
			this.human.body.ShowUnderHair3D(flag);
		}
	}

	// Token: 0x0600092D RID: 2349 RVA: 0x00035CD4 File Offset: 0x00033ED4
	public void ChangeBodyMaterial(Renderer bodySkin)
	{
		SkinnedMeshRenderer[] componentsInChildren = this.wearsRoot.GetComponentsInChildren<SkinnedMeshRenderer>(true);
		string text = (this.sex != SEX.FEMALE) ? Wears.name_skinMaterial_M : Wears.name_skinMaterial_F;
		text += "_CustomMaterial";
		foreach (SkinnedMeshRenderer skinnedMeshRenderer in componentsInChildren)
		{
			bool flag = false;
			for (int j = 0; j < skinnedMeshRenderer.sharedMaterials.Length; j++)
			{
				if (skinnedMeshRenderer.sharedMaterials[j].name.IndexOf(text) == 0)
				{
					flag = true;
					break;
				}
			}
			if (flag)
			{
				skinnedMeshRenderer.sharedMaterials = bodySkin.sharedMaterials;
			}
		}
	}

	// Token: 0x0600092E RID: 2350 RVA: 0x00035D88 File Offset: 0x00033F88
	private void ReAttachDynamicBone(GameObject obj)
	{
		DynamicBone[] componentsInChildren = obj.GetComponentsInChildren<DynamicBone>(true);
		DynamicBoneCollider[] componentsInChildren2 = this.baseBoneRoot.GetComponentsInChildren<DynamicBoneCollider>(true);
		foreach (DynamicBone dynamicBone in componentsInChildren)
		{
			Transform transform = Transform_Utility.FindTransform(this.baseBoneRoot, dynamicBone.m_Root.name);
			if (transform != null)
			{
				dynamicBone.m_Root = transform;
			}
			else
			{
				GlobalData.Debug_LogError("动态骨片更换失败:" + dynamicBone.m_Root.name);
			}
			dynamicBone.m_Colliders.Clear();
			foreach (DynamicBoneCollider item in componentsInChildren2)
			{
				dynamicBone.m_Colliders.Add(item);
			}
		}
	}

	// Token: 0x0600092F RID: 2351 RVA: 0x00035E50 File Offset: 0x00034050
	public void ChangeShow(WEAR_SHOW_TYPE type, WEAR_SHOW show)
	{
		this.showModes[(int)type] = show;
		(this.human as Female).SafeProc(delegate(Female f)
		{
			f.wearShow[(int)type] = show;
		});
		if (this.human.sex == SEX.FEMALE && !this.human.visibleAll)
		{
			return;
		}
		this.UpdateShow(type);
	}

	// Token: 0x06000930 RID: 2352 RVA: 0x00035ED0 File Offset: 0x000340D0
	public void ChangeShow_StripOnly(WEAR_SHOW_TYPE type, WEAR_SHOW show)
	{
		if (this.showModes[(int)type] < show)
		{
			this.showModes[(int)type] = show;
			this.UpdateShow(type);
		}
	}

	// Token: 0x06000931 RID: 2353 RVA: 0x00035EF0 File Offset: 0x000340F0
	public WEAR_SHOW GetShow(WEAR_SHOW_TYPE showType, bool checkPair)
	{
		WEAR_SHOW result = this.showModes[(int)showType];
		WEAR_TYPE wear_TYPE = Wears.ShowToWearType[(int)showType];
		if (!checkPair || this.wearObjs[(int)wear_TYPE] == null || !this.wearObjs[(int)wear_TYPE].HasLowerShow())
		{
			return result;
		}
		if (wear_TYPE == WEAR_TYPE.SWIM)
		{
			WearData wearData = this.GetWearData(WEAR_TYPE.SWIM);
			if (wearData != null && wearData.coordinates == 0)
			{
				return result;
			}
		}
		if (showType == WEAR_SHOW_TYPE.TOPUPPER && this.showModes[1] == WEAR_SHOW.HIDE)
		{
			result = WEAR_SHOW.HIDE;
		}
		if (showType == WEAR_SHOW_TYPE.TOPLOWER && this.showModes[0] == WEAR_SHOW.HIDE)
		{
			result = WEAR_SHOW.HIDE;
		}
		if (showType == WEAR_SHOW_TYPE.SWIMUPPER && this.showModes[6] == WEAR_SHOW.HIDE)
		{
			result = WEAR_SHOW.HIDE;
		}
		if (showType == WEAR_SHOW_TYPE.SWIMLOWER && this.showModes[5] == WEAR_SHOW.HIDE)
		{
			result = WEAR_SHOW.HIDE;
		}
		if (showType == WEAR_SHOW_TYPE.SWIM_TOPUPPER && this.showModes[8] == WEAR_SHOW.HIDE)
		{
			result = WEAR_SHOW.HIDE;
		}
		if (showType == WEAR_SHOW_TYPE.SWIM_TOPLOWER && this.showModes[7] == WEAR_SHOW.HIDE)
		{
			result = WEAR_SHOW.HIDE;
		}
		return result;
	}

	// Token: 0x06000932 RID: 2354 RVA: 0x00035FE4 File Offset: 0x000341E4
	public static WEAR_SHOW_TYPE GetWearShowTypePair(WEAR_SHOW_TYPE showType)
	{
		if (showType == WEAR_SHOW_TYPE.TOPUPPER)
		{
			return WEAR_SHOW_TYPE.TOPLOWER;
		}
		if (showType == WEAR_SHOW_TYPE.TOPLOWER)
		{
			return WEAR_SHOW_TYPE.TOPUPPER;
		}
		if (showType == WEAR_SHOW_TYPE.SWIMUPPER)
		{
			return WEAR_SHOW_TYPE.SWIMLOWER;
		}
		if (showType == WEAR_SHOW_TYPE.SWIMLOWER)
		{
			return WEAR_SHOW_TYPE.SWIMUPPER;
		}
		if (showType == WEAR_SHOW_TYPE.SWIM_TOPUPPER)
		{
			return WEAR_SHOW_TYPE.SWIM_TOPLOWER;
		}
		if (showType == WEAR_SHOW_TYPE.SWIM_TOPLOWER)
		{
			return WEAR_SHOW_TYPE.SWIM_TOPUPPER;
		}
		return WEAR_SHOW_TYPE.NUM;
	}

	// Token: 0x06000933 RID: 2355 RVA: 0x00036020 File Offset: 0x00034220
	private void UpdateShow(WEAR_TYPE type)
	{
		if (type == WEAR_TYPE.TOP)
		{
			this.UpdateShow(WEAR_SHOW_TYPE.TOPUPPER);
			this.UpdateShow(WEAR_SHOW_TYPE.TOPLOWER);
		}
		else if (type == WEAR_TYPE.SWIM_TOP)
		{
			this.UpdateShow(WEAR_SHOW_TYPE.SWIM_TOPUPPER);
			this.UpdateShow(WEAR_SHOW_TYPE.SWIM_TOPLOWER);
		}
		else if (type == WEAR_TYPE.SWIM)
		{
			this.UpdateShow(WEAR_SHOW_TYPE.SWIMUPPER);
			this.UpdateShow(WEAR_SHOW_TYPE.SWIMLOWER);
		}
		else
		{
			this.UpdateShow(Wears.WeatToShowType[(int)type]);
		}
	}

	// Token: 0x06000934 RID: 2356 RVA: 0x00036088 File Offset: 0x00034288
	private void UpdateShow(WEAR_SHOW_TYPE showType)
	{
		WEAR_TYPE wear_TYPE = Wears.ShowToWearType[(int)showType];
		int num = (int)wear_TYPE;
		if (this.wearObjs[num] == null)
		{
			return;
		}
		GameObject obj = this.wearObjs[num].obj;
		WEAR_SHOW show = this.GetShow(showType, true);
		bool flag = true;
		bool flag2 = false;
		if (wear_TYPE == WEAR_TYPE.SWIM)
		{
			WearData wearData = this.GetWearData(WEAR_TYPE.SWIM);
			if (wearData != null && wearData.coordinates == 0)
			{
				flag2 = true;
			}
		}
		if (!flag2)
		{
			flag = (show != WEAR_SHOW.HIDE);
		}
		if (flag)
		{
			flag = Wears.IsEnableWear(this.wearParam.isSwimwear, wear_TYPE);
		}
		if (wear_TYPE == WEAR_TYPE.BRA && flag)
		{
			if (this.wearObjs[0] != null && this.GetShow(WEAR_SHOW_TYPE.TOPUPPER, true) == WEAR_SHOW.ALL)
			{
				flag = false;
			}
			WearData wearData2 = this.GetWearData(WEAR_TYPE.TOP);
			WearData wearData3 = this.GetWearData(WEAR_TYPE.BOTTOM);
			if (wearData2 != null && wearData2.braDisable)
			{
				flag = false;
			}
			if (wearData3 != null && wearData3.braDisable)
			{
				flag = false;
			}
		}
		if (wear_TYPE == WEAR_TYPE.SHORTS && flag)
		{
			WearData wearData4 = this.GetWearData(WEAR_TYPE.TOP);
			WearData wearData5 = this.GetWearData(WEAR_TYPE.BOTTOM);
			if (wearData4 != null && wearData4.shortsDisable)
			{
				flag = false;
			}
			if (wearData5 != null && wearData5.shortsDisable)
			{
				flag = false;
			}
		}
		if (wear_TYPE == WEAR_TYPE.BOTTOM && flag)
		{
			WearData wearData6 = this.GetWearData(WEAR_TYPE.TOP);
			if (wearData6 != null && wearData6.coordinates == 2)
			{
				flag = false;
			}
		}
		WearObj wearObj = this.wearObjs[num];
		if (Wears.IsLower(showType))
		{
			wearObj.ChangeShow_Lower(show);
		}
		else
		{
			wearObj.obj.SetActive(flag);
			if (wearObj.liquid != null && wearObj.liquid.root != null)
			{
				wearObj.liquid.root.SetActive(flag);
			}
			wearObj.ChangeShow_Upper(show);
		}
	}

	// Token: 0x06000935 RID: 2357 RVA: 0x00036274 File Offset: 0x00034474
	public static bool IsEnableWear(bool isSwim, WEAR_TYPE type)
	{
		if (type == WEAR_TYPE.GLOVE || type == WEAR_TYPE.PANST || type == WEAR_TYPE.SOCKS || type == WEAR_TYPE.SHOES)
		{
			return true;
		}
		if (isSwim)
		{
			return type == WEAR_TYPE.SWIM || type == WEAR_TYPE.SWIM_TOP || type == WEAR_TYPE.SWIM_BOTTOM;
		}
		return type == WEAR_TYPE.TOP || type == WEAR_TYPE.BOTTOM || type == WEAR_TYPE.BRA || type == WEAR_TYPE.SHORTS;
	}

	// Token: 0x06000936 RID: 2358 RVA: 0x000362D8 File Offset: 0x000344D8
	public void BustUVNormal(float rate)
	{
		for (int i = 0; i < this.wearObjs.Length; i++)
		{
			if (this.wearObjs[i] != null && this.wearObjs[i].uv_normal != null)
			{
				this.wearObjs[i].uv_normal.Rate = rate;
			}
		}
	}

	// Token: 0x06000937 RID: 2359 RVA: 0x00036338 File Offset: 0x00034538
	public bool IsEquiped(CustomParameter param, WEAR_TYPE type)
	{
		return Wears.IsEnableWear(this.wearParam.isSwimwear, type) && (type != WEAR_TYPE.BRA || Wears.CheckBraEnable(this.sex, param)) && (type != WEAR_TYPE.SHORTS || Wears.CheckShortsEnable(this.sex, param)) && (type != WEAR_TYPE.BOTTOM || Wears.CheckBottomsEnable(this.sex, param)) && this.wearObjs[(int)type] != null;
	}

	// Token: 0x06000938 RID: 2360 RVA: 0x000363BC File Offset: 0x000345BC
	public bool IsEquiped(CustomParameter param, WEAR_SHOW_TYPE type)
	{
		WEAR_TYPE wear_TYPE = Wears.ShowToWearType[(int)type];
		return this.IsEquiped(param, wear_TYPE) && this.wearObjs[(int)wear_TYPE].HasShow(type);
	}

	// Token: 0x06000939 RID: 2361 RVA: 0x000363F0 File Offset: 0x000345F0
	public static bool IsLower(WEAR_SHOW_TYPE showType)
	{
		return showType == WEAR_SHOW_TYPE.TOPLOWER || showType == WEAR_SHOW_TYPE.SWIMLOWER || showType == WEAR_SHOW_TYPE.SWIM_TOPLOWER;
	}

	// Token: 0x0600093A RID: 2362 RVA: 0x00036408 File Offset: 0x00034608
	public static void CheckBraShortsEnable(SEX sex, CustomParameter customParam, out bool braEnable, out bool shortsEnable)
	{
		braEnable = true;
		shortsEnable = true;
		if (sex == SEX.FEMALE)
		{
			WearData wearData_Female = CustomDataManager.GetWearData_Female(WEAR_TYPE.TOP, customParam.wear.GetWearID(WEAR_TYPE.TOP));
			WearData wearData_Female2 = CustomDataManager.GetWearData_Female(WEAR_TYPE.BOTTOM, customParam.wear.GetWearID(WEAR_TYPE.BOTTOM));
			if (wearData_Female != null)
			{
				if (wearData_Female.braDisable)
				{
					braEnable = false;
				}
				if (wearData_Female.shortsDisable)
				{
					shortsEnable = false;
				}
			}
			if (wearData_Female2 != null)
			{
				if (wearData_Female2.braDisable)
				{
					braEnable = false;
				}
				if (wearData_Female2.shortsDisable)
				{
					shortsEnable = false;
				}
			}
		}
	}

	// Token: 0x0600093B RID: 2363 RVA: 0x0003648C File Offset: 0x0003468C
	public static bool CheckBraEnable(SEX sex, CustomParameter customParam)
	{
		bool result = true;
		if (sex == SEX.FEMALE)
		{
			WearData wearData_Female = CustomDataManager.GetWearData_Female(WEAR_TYPE.TOP, customParam.wear.GetWearID(WEAR_TYPE.TOP));
			WearData wearData_Female2 = CustomDataManager.GetWearData_Female(WEAR_TYPE.BOTTOM, customParam.wear.GetWearID(WEAR_TYPE.BOTTOM));
			if (wearData_Female != null && wearData_Female.braDisable)
			{
				result = false;
			}
			if (wearData_Female2 != null && wearData_Female2.braDisable)
			{
				result = false;
			}
		}
		return result;
	}

	// Token: 0x0600093C RID: 2364 RVA: 0x000364F0 File Offset: 0x000346F0
	public static bool CheckShortsEnable(SEX sex, CustomParameter customParam)
	{
		bool result = true;
		if (sex == SEX.FEMALE)
		{
			WearData wearData_Female = CustomDataManager.GetWearData_Female(WEAR_TYPE.TOP, customParam.wear.GetWearID(WEAR_TYPE.TOP));
			WearData wearData_Female2 = CustomDataManager.GetWearData_Female(WEAR_TYPE.BOTTOM, customParam.wear.GetWearID(WEAR_TYPE.BOTTOM));
			if (wearData_Female != null && wearData_Female.shortsDisable)
			{
				result = false;
			}
			if (wearData_Female2 != null && wearData_Female2.shortsDisable)
			{
				result = false;
			}
		}
		return result;
	}

	// Token: 0x0600093D RID: 2365 RVA: 0x00036554 File Offset: 0x00034754
	public static bool CheckBottomsEnable(SEX sex, CustomParameter customParam)
	{
		bool result = true;
		if (sex == SEX.FEMALE)
		{
			WearData wearData_Female = CustomDataManager.GetWearData_Female(WEAR_TYPE.TOP, customParam.wear.GetWearID(WEAR_TYPE.TOP));
			WearData wearData_Female2 = CustomDataManager.GetWearData_Female(WEAR_TYPE.BOTTOM, customParam.wear.GetWearID(WEAR_TYPE.BOTTOM));
			if (wearData_Female != null)
			{
				if (wearData_Female.coordinates == 2)
				{
					result = false;
				}
				if (wearData_Female2 != null && wearData_Female.coordinates == 1 && wearData_Female2.coordinates != 0)
				{
					result = false;
				}
			}
		}
		return result;
	}

	// Token: 0x0600093E RID: 2366 RVA: 0x000365C4 File Offset: 0x000347C4
	public int GetWearShowNum(WEAR_SHOW_TYPE showType)
	{
		WEAR_TYPE wear_TYPE = Wears.ShowToWearType[(int)showType];
		WearObj wearObj = this.wearObjs[(int)wear_TYPE];
		if (wearObj == null)
		{
			return 0;
		}
		if (Wears.IsLower(showType))
		{
			return wearObj.ShowLowerNum;
		}
		return wearObj.ShowUpperNum;
	}

	// Token: 0x0600093F RID: 2367 RVA: 0x00036604 File Offset: 0x00034804
	public void UpdateLiquid(int[] sperms)
	{
		for (int i = 0; i < this.wearObjs.Length; i++)
		{
			if (this.wearObjs[i] != null && this.wearObjs[i].liquid != null)
			{
				this.wearObjs[i].SetLiquidShow(sperms);
			}
		}
	}

	// Token: 0x040008E8 RID: 2280
	private SEX sex;

	// Token: 0x040008E9 RID: 2281
	private WearParameter wearParam;

	// Token: 0x040008EA RID: 2282
	private Transform baseBoneRoot;

	// Token: 0x040008EB RID: 2283
	private Transform wearsRoot;

	// Token: 0x040008EC RID: 2284
	private GameObject skinObj;

	// Token: 0x040008ED RID: 2285
	private SkinnedMeshRenderer bodySkinMesh;

	// Token: 0x040008EE RID: 2286
	private Human human;

	// Token: 0x040008EF RID: 2287
	private string wear_meshRootName = string.Empty;

	// Token: 0x040008F0 RID: 2288
	private WearObj[] wearObjs = new WearObj[11];

	// Token: 0x040008F1 RID: 2289
	private WEAR_SHOW[] showModes = new WEAR_SHOW[14];

	// Token: 0x040008F2 RID: 2290
	private static readonly string name_baseBoneRoot_F = "p_cf_anim/cf_J_Root";

	// Token: 0x040008F3 RID: 2291
	private static readonly string name_baseBoneRoot_M = "p_cm_anim/cm_J_Root";

	// Token: 0x040008F4 RID: 2292
	private static readonly string name_baseBoneRoot_MannequimF = "cf_J_Root";

	// Token: 0x040008F5 RID: 2293
	private static readonly string name_baseBoneRoot_MannequimM = "cm_J_Root";

	// Token: 0x040008F6 RID: 2294
	private static readonly string name_skinObj_F = "cf_O_body_00";

	// Token: 0x040008F7 RID: 2295
	private static readonly string name_skinObj_M = "O_body";

	// Token: 0x040008F8 RID: 2296
	private static readonly string name_wear_meshRootName_F = "cf_N_O_root";

	// Token: 0x040008F9 RID: 2297
	private static readonly string name_wear_meshRootName_M = "cm_N_O_root";

	// Token: 0x040008FA RID: 2298
	private static readonly string name_skinMaterial_F = "cf_m_body";

	// Token: 0x040008FB RID: 2299
	private static readonly string name_skinMaterial_M = "cm_m_body";

	// Token: 0x040008FC RID: 2300
	private static readonly string name_wearsRoot = "Wears";

	// Token: 0x040008FD RID: 2301
	private static readonly string name_defMaterial = "Default-Material";

	// Token: 0x040008FE RID: 2302
	public static readonly WEAR_SHOW_TYPE[] WeatToShowType = new WEAR_SHOW_TYPE[]
	{
		WEAR_SHOW_TYPE.NUM,
		WEAR_SHOW_TYPE.BOTTOM,
		WEAR_SHOW_TYPE.BRA,
		WEAR_SHOW_TYPE.SHORTS,
		WEAR_SHOW_TYPE.NUM,
		WEAR_SHOW_TYPE.NUM,
		WEAR_SHOW_TYPE.SWIM_BOTTOM,
		WEAR_SHOW_TYPE.GLOVE,
		WEAR_SHOW_TYPE.PANST,
		WEAR_SHOW_TYPE.SOCKS,
		WEAR_SHOW_TYPE.SHOES
	};

	// Token: 0x040008FF RID: 2303
	public static readonly WEAR_TYPE[] ShowToWearType = new WEAR_TYPE[]
	{
		WEAR_TYPE.TOP,
		WEAR_TYPE.TOP,
		WEAR_TYPE.BOTTOM,
		WEAR_TYPE.BRA,
		WEAR_TYPE.SHORTS,
		WEAR_TYPE.SWIM,
		WEAR_TYPE.SWIM,
		WEAR_TYPE.SWIM_TOP,
		WEAR_TYPE.SWIM_TOP,
		WEAR_TYPE.SWIM_BOTTOM,
		WEAR_TYPE.GLOVE,
		WEAR_TYPE.PANST,
		WEAR_TYPE.SOCKS,
		WEAR_TYPE.SHOES
	};

	// Token: 0x04000900 RID: 2304
	public static readonly string name_swimOptTop = "N_top_op1";

	// Token: 0x04000901 RID: 2305
	public static readonly string name_swimOptBot = "N_bot_op1";
}
